
/**
 * 商品类
 */


public class Item {
    private String code;    // 商品编号
    private String name;    // 商品名称
    private double price;   // 单价
    private int quantity;   // 数量

    public Item(String code, String name, double price, int quantity) {
        this.code = code;
        this.name = name;
        this.price = price;
        this.quantity = quantity;
    }

    // Getter和Setter方法
    public String getCode() { return code; }
    public String getName() { return name; }
    public double getPrice() { return price; }
    public int getQuantity() { return quantity; }
}
